You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Dew.Math.Units Namespace > Classes > MtxIntDiff Class > MtxIntDiff Methods > QuadGauss Method > MtxIntDiff.QuadGauss Method (TRealFunction, double, double, out TIntStopReason, [In] TMtxFloatPrecision, TQuadMethod, double, int)
Dew Math for .NET
ContentsIndexHome
PreviousUpNext
MtxIntDiff.QuadGauss Method (TRealFunction, double, double, out TIntStopReason, [In] TMtxFloatPrecision, TQuadMethod, double, int)

Integration by using Gauss quadrature algorithm with no additional parameters for Fun.

Syntax
C#
Visual Basic
public static double QuadGauss(TRealFunction Fun, double lb, double ub, out TIntStopReason StopReason, [In] TMtxFloatPrecision FloatPrecision, TQuadMethod QMethod, double Tolerance, int MaxIter);

the numerical approximate on integral of function Fun between limits lb and ub.

This version calculates base points and weights on the fly. 

Note Use this overload if integrating function is defined only by double parameter(s).

Evaluate fuction Sin(x)*Exp(-x^2) on interval [-PI/2, PI]. Use default Gauss base points and weights. 

 

private double IntFun(TVec x, TVec c, params object[] o) { double x = x[0]; return System.Math.Sin(x)*System.Math.Exp(-x*x); } private void Example() { TIntStopReason sr; double area = MtxIntDif.QuadGauss(IntFun,-0.5*System.Math.PI, System.Math.PI, out sr, 1.0e-4, 8); }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!